<%@page import="org.codehaus.jackson.map.ObjectMapper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%!
	public static class tt{
		private String indexName ;
		
		private String goWhere ;
		
		public String getIndexName(){
			return this.indexName ;
		}
		
		public void setIndexName(String indexName){
			this.indexName = indexName ;
		}
		
		public String getGoWhere(){
			return this.goWhere ;
		}
		
		public void setGoWhere(String goWhere){
			this.goWhere = goWhere;
		}
	}
%>

<%
String str = request.getParameter("str")+"";
String type = request.getParameter("type")+"";

System.out.println("str:"+str);

if(!"null".equals(str) && "json".equals(type)){
	ObjectMapper map = new ObjectMapper();
	tt t = map.readValue(str,tt.class);
// 	System.out.println(t.getIndexName()); 
// 	out.println("indexName:"+t.getIndexName() + ",goWhere:"+t.getGoWhere());
	response.setHeader("Content-type","application/json");
	String result = map.writeValueAsString(t);
	out.print(result);
}else{
	ObjectMapper map = new ObjectMapper();
	tt t = map.readValue(str,tt.class);
// 	out.println("indexName:"+t.getIndexName() + ",goWhere:"+t.getGoWhere());
// 	response.setHeader("Content-type","application/json");
	String result = map.writeValueAsString(t);
	out.print(result);
}
%>